home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / SampleTemplate / Sample Template / Source / AlbumConditional.r < prev    next >
Encoding:
Text File  |  1993-09-07  |  11.8 KB  |  359 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        AlbumInfoPage.r
  3.  
  4.     Contains:    Aspect and Information page resources for album sample template
  5.  
  6.     Written by: Harry Chesley, Steve Fisher, Bruce Gaya
  7.  
  8.     Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.                   5/6/93    BG        revised for 1993 WWDC
  13.  
  14.     To Do:
  15. */
  16.  
  17. #include "Types.r"
  18. #include "OCETemplates.h"
  19. #include "OCE.r"
  20.  
  21. // --------------------------------------------------------------------
  22. // --------------------------------------------------------------------
  23. //
  24. // Album Main Aspect
  25. //
  26. // --------------------------------------------------------------------
  27. // --------------------------------------------------------------------
  28.  
  29.  
  30. /////////////////////////////////////////////////////////////////////////
  31. //
  32. // BOOKKEEPING - this is an aspect template with this base resource id
  33. //
  34. /////////////////////////////////////////////////////////////////////////
  35.  
  36. #define kAlbumMainAspect        kDETFirstID
  37.  
  38. resource 'deta' (kAlbumMainAspect, purgeable) {
  39.     0,                    // Drop priority
  40.     dropCheckAlways,    // Drop check flag
  41.     isMainAspect        // Is the main aspect
  42. };
  43.  
  44. resource 'rstr' (kAlbumMainAspect+kDETTemplateName, purgeable) {
  45.     "Album Main Aspect"
  46. };
  47.  
  48.  
  49. /////////////////////////////////////////////////////////////////////////
  50. //
  51. // BINDING - associate this aspect with records of this type
  52. //
  53. /////////////////////////////////////////////////////////////////////////
  54.  
  55. resource 'rstr' (kAlbumMainAspect+kDETRecordType, purgeable) {
  56.     "Album"
  57. };
  58.  
  59.  
  60. /////////////////////////////////////////////////////////////////////////
  61. //
  62. // BEHAVIOR - record icon’s behaviour
  63. //
  64. /////////////////////////////////////////////////////////////////////////
  65.  
  66. resource 'rst#' (kAlbumMainAspect+kDETAspectCategory,purgeable)
  67.     {{
  68.     "Recordings"
  69.     }};
  70.  
  71. resource 'rstr' (kAlbumMainAspect+kDETAspectNewMenuName, purgeable) {
  72.     "New Album"
  73. };
  74.  
  75. resource 'rstr' (kAlbumMainAspect+kDETAspectNewEntryName, purgeable) {
  76.     "untitled album"
  77. };
  78.  
  79.  
  80. /////////////////////////////////////////////////////////////////////////
  81. //
  82. // USER INTERFACE RESOURCES - for looking good
  83. //
  84. /////////////////////////////////////////////////////////////////////////
  85.  
  86. resource 'rstr' (kAlbumMainAspect+kDETAspectKind, purgeable) {
  87.     "album"
  88. };
  89.  
  90. resource 'rstr' (kAlbumMainAspect+kDETAspectWhatIs, purgeable) {
  91.     "Album\n\nA description of an album."
  92. };
  93.  
  94.  
  95. // icons
  96.  
  97. include "AlbumIcons" 'ICN#'(0) as 'ICN#'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  98. include "AlbumIcons" 'icl4'(0) as 'icl4'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  99. include "AlbumIcons" 'icl8'(0) as 'icl8'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  100. include "AlbumIcons" 'ics#'(0) as 'ics#'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  101. include "AlbumIcons" 'ics4'(0) as 'ics4'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  102. include "AlbumIcons" 'ics8'(0) as 'ics8'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  103. include "AlbumIcons" 'SICN'(0) as 'SICN'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  104.  
  105. /////////////////////////////////////////////////////////////////////////
  106. //
  107. // ASPECT PROPERTIES - shared between aspect and info page(s)
  108. //
  109. /////////////////////////////////////////////////////////////////////////
  110.  
  111. #define prTitle                        kDETFirstDevProperty
  112. #define prArtist                    kDETFirstDevProperty + 1
  113. #define prComments                    kDETFirstDevProperty + 2
  114. #define prFormat                    kDETFirstDevProperty + 3
  115. #define prCover                        kDETFirstDevProperty + 4
  116. #define prVinylSpeed                kDETFirstDevProperty + 5
  117.  
  118. //----------------------------------------------------------------------
  119. //
  120. // Lookup resource - what attributes to lookup,
  121. //                     how to assign them to properties
  122. //
  123. //----------------------------------------------------------------------
  124. resource 'dett' (kAlbumMainAspect+kDETAspectLookup, purgeable) {
  125.     {
  126.     {"Album General Info"}, typeBinary,
  127.         useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  128.         {
  129.             'rstr', prTitle, 0;
  130.             'rstr', prArtist, 0;
  131.             'rstr', prComments, 0;
  132.             'word', prFormat, 0;
  133.             'word', prVinylSpeed, 0;
  134.         };
  135.     {"Album Cover"}, typeBinary,
  136.         useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  137.         { 'rest', prCover , 0 };
  138.     }
  139. };
  140.  
  141. //----------------------------------------------------------------------
  142. //
  143. // Default property values - show this if attributes are missing
  144. //
  145. //----------------------------------------------------------------------
  146.  
  147. resource 'rstr' (kAlbumMainAspect+prTitle) {
  148.     "<Put the album’s full title here.>"
  149. };
  150.  
  151. resource 'rstr' (kAlbumMainAspect+prArtist) {
  152.     "<Put the album’s recording artist or group here.>"
  153. };
  154.  
  155. resource 'rstr' (kAlbumMainAspect+prComments) {
  156.     "<Put comments here.  Did you like it?  What's the best track?>"
  157. };
  158.  
  159. resource 'detn' (kAlbumMainAspect+prFormat) {
  160.     1
  161. };
  162.  
  163. resource 'detn' (kAlbumMainAspect+prVinylSpeed) {
  164.     1
  165. };
  166.  
  167. include "AlbumIcons" 'detb'(0) as 'detb'(kAlbumMainAspect+prCover, purgeable);
  168.  
  169.  
  170. //----------------------------------------------------------------------
  171. //
  172. // Balloon help for the properties
  173. //
  174. //----------------------------------------------------------------------
  175.  
  176. resource 'rst#' (kAlbumMainAspect+kDETAspectBalloons,purgeable) {
  177.     {
  178.     "The full title.",        "The full title. Uneditable because the record is locked or access controled.",
  179.     "The artist or group.",    "The artist or group. Uneditable because the record is locked or access controled.",
  180.     "Comments.",            "Comments. Uneditable because the record is locked or access controled.",
  181.     "Format.",                "Format. Uneditable because the record is locked or access controled."
  182.     "Album’s cover.",        "Album’s cover. Uneditable because the record is locked or access controled."
  183.     "Cassette type",        "Cassette type. Uneditable because the record is locked or access controled."
  184.     "Record speed",            "Record speed. Uneditable because the record is locked or access controled."
  185.     }
  186. };
  187.  
  188.  
  189. // --------------------------------------------------------------------
  190. // --------------------------------------------------------------------
  191. //
  192. // Album Information Page
  193. //
  194. // --------------------------------------------------------------------
  195. // --------------------------------------------------------------------
  196.  
  197.  
  198. /////////////////////////////////////////////////////////////////////////
  199. //
  200. // BOOKKEEPING - this is an information page template with this base resource id
  201. //                 and this view
  202. //
  203. /////////////////////////////////////////////////////////////////////////
  204.  
  205. #define kAlbumInfoPage            kDETSecondID
  206.  
  207.  
  208. resource 'deti' (kAlbumInfoPage, purgeable) {
  209.     1000,
  210.     {0, 0, 0, 0},
  211.     selectFirstText, 
  212.     {
  213.         kDETNoProperty, kDETNoProperty, kAlbumInfoPage;
  214.         prFormat, kDETFirstConstantProperty + 3, kAlbumInfoPage + 1;
  215.     },
  216.     {
  217.     }
  218. };
  219.  
  220. resource 'rstr' (kAlbumInfoPage+kDETTemplateName, purgeable) {
  221.     "Album 1st Info Page"
  222. };
  223.  
  224. resource 'rstr' (kAlbumInfoPage+kDETInfoPageName, purgeable) {
  225.     "General Info"
  226. };
  227.  
  228.  
  229. /////////////////////////////////////////////////////////////////////////
  230. //
  231. // BINDING - associate this information page with records of this type
  232. //             and with this aspect
  233. //
  234. /////////////////////////////////////////////////////////////////////////
  235.  
  236. resource 'rstr' (kAlbumInfoPage+kDETRecordType, purgeable) {
  237.     "Album"
  238. };
  239.  
  240. resource 'rstr' (kAlbumInfoPage+kDETInfoPageMainViewAspect, purgeable) {
  241.     "Album Main Aspect"
  242. };
  243.  
  244.  
  245.  
  246. /////////////////////////////////////////////////////////////////////////
  247. //
  248. // VIEWS - what you see in this information page
  249. //
  250. /////////////////////////////////////////////////////////////////////////
  251.  
  252. #define kCoverTop                        (kDETSubpageIconBottom + 8)
  253. #define kCoverLeft                        (kDETSubpageIconLeft-2)
  254. #define kCoverBottom                    (kCoverTop + 175)
  255. #define kCoverRight                        (kCoverLeft + 175)
  256.  
  257. #define k1stColumnLeft                    (kCoverRight+4)
  258. #define k1stColumnRight                    (k1stColumnLeft+65)
  259. #define k2ndColumnLeft                    (k1stColumnRight+4)
  260. #define k2ndColumnRight                    (kDETRecordInfoWindWidth - 8)
  261.  
  262. #define kTitleTop                        (kCoverTop)
  263. #define kTitleBottom                    (kTitleTop + kDETAppFontLineHeight + 4)
  264. #define kArtistTop                        (kTitleBottom + 6)
  265. #define kArtistBottom                    (kArtistTop + kDETAppFontLineHeight + 4)
  266. #define kFormatTop                        (kArtistBottom + 6)
  267. #define kFormatBottom                    (kFormatTop + kDETAppFontLineHeight + 4)
  268. #define kNumFormats                        (3)
  269. #define kCDRadioLeft                    (k2ndColumnLeft)
  270. #define kCDRadioRight                    (kCDRadioLeft + 35)
  271. #define kCassetteRadioLeft                (kCDRadioRight)
  272. #define kCassetteRadioRight                (kCassetteRadioLeft + 60)
  273. #define kVinylRadioLeft                    (kCassetteRadioRight)
  274. #define kVinylRadioRight                (k2ndColumnRight)
  275. #define kCommentsTop                    (kFormatBottom + 32)
  276. #define kCommentsLabelBottom            (kCommentsTop + kDETAppFontLineHeight + 4)
  277. #define kCommentsBottom                    (kCoverBottom)
  278.  
  279. #define kConditionalTop                    (kFormatBottom + 4)
  280. #define kConditionalBottom                (kConditionalTop + kDETAppFontLineHeight + 4)
  281. #define k33RadioLeft                    (k2ndColumnLeft)
  282. #define k33RadioRight                    (kCDRadioLeft + 35)
  283. #define k45RadioLeft                    (k33RadioRight)
  284. #define k45RadioRight                    (k45RadioLeft + 35)
  285. #define k78RadioLeft                    (k45RadioRight)
  286. #define k78RadioRight                    (k45RadioRight + 35)
  287.  
  288. resource 'detv' (kAlbumInfoPage, purgeable) {
  289.     {
  290.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  291.     Bitmap { kDETLargeIcon };
  292.  
  293.  
  294.     {kTitleTop, k1stColumnLeft, kTitleBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  295.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  296.         "Full title:" };
  297.     
  298.     {kTitleTop-2, k2ndColumnLeft, kTitleBottom-2, k2ndColumnRight}, kDETEnabled, prTitle,
  299.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  300.  
  301.  
  302.     {kArtistTop, k1stColumnLeft, kArtistBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  303.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  304.         "Artist:" };
  305.  
  306.     {kArtistTop-2, k2ndColumnLeft, kArtistBottom-2, k2ndColumnRight}, kDETEnabled, prArtist,
  307.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  308.  
  309.  
  310.     {kFormatTop, k1stColumnLeft, kFormatBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  311.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  312.         "Format:" };
  313.  
  314.     {kFormatTop, kCDRadioLeft, kFormatBottom, kCDRadioRight}, kDETEnabled, prFormat,
  315.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  316.             "CD", prFormat, 1 };
  317.  
  318.     {kFormatTop, kCassetteRadioLeft, kFormatBottom, kCassetteRadioRight}, kDETEnabled, prFormat,
  319.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  320.             "Cassette", prFormat, 2 };
  321.  
  322.     {kFormatTop, kVinylRadioLeft, kFormatBottom, kVinylRadioRight}, kDETEnabled, prFormat,
  323.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  324.             "Vinyl", prFormat, 3 };
  325.  
  326.     {kCommentsTop, k1stColumnLeft, kCommentsLabelBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  327.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  328.         "Comments:" };
  329.  
  330.     {kCommentsLabelBottom, k1stColumnLeft, kCommentsBottom-2, k2ndColumnRight}, kDETEnabled + kDETMultiLine, prComments,
  331.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  332.  
  333.     { kCoverTop, kCoverLeft, kCoverBottom, kCoverRight }, kDETNoFlags, prCover,
  334.     EditPicture { 8 };
  335.     }
  336. };
  337.  
  338. resource 'detv' (kAlbumInfoPage + 1, purgeable) {
  339.     {
  340.     {kConditionalTop, k1stColumnLeft, kConditionalBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  341.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  342.         "Speed:" };
  343.  
  344.     {kConditionalTop, k33RadioLeft, kConditionalBottom, k33RadioRight}, kDETEnabled, prVinylSpeed,
  345.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  346.             "33", prVinylSpeed, 1 };
  347.  
  348.     {kConditionalTop, k45RadioLeft, kConditionalBottom, k45RadioRight}, kDETEnabled, prVinylSpeed,
  349.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  350.             "45", prVinylSpeed, 2 };
  351.  
  352.     {kConditionalTop, k78RadioLeft, kConditionalBottom, k78RadioRight}, kDETEnabled, prVinylSpeed,
  353.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  354.             "78", prVinylSpeed, 3 };
  355.     }
  356. };
  357.  
  358.  
  359.